<?php
/*\
 *	
 *	
 *	
 *	
\*/

function dmodel_get_args($q,$d="name") {
	if (is_string($q)) {
		parse_str($q,$o);
		$k = array_keys($o);
		if (isset($k[0])) {
			if ($o[$k[0]]=="") {
				$o[$d]=$k[0];
				unset($o[$k[0]]);
			}		
		}
	}
	$a = new stdClass();
	
	$a->get  = isset($o['get'])  ? $o['get']  : "";
	$a->form = isset($o['form']) ? $o['form'] : "";
	$a->name = isset($o['name']) ? $o['name'] : "";
	$a->class = isset($o['class']) ? $o['class'] : "";
	foreach($o as $k=>$v) {
		$a->{$k} = $v;
	}
	return $a;
}

function dmodel_get_prefix() {
	return "oh_";
}

function dmodel_is_object_standard_field($x) {
	$p = dmodel_get_prefix();
	$q = "SHOW COLUMNS FROM {$p}object";
	$r = dmodel_query($q);
	$e = array();
	foreach($r as $f) {
		$e[] = $f->Field;
	}	
	return in_array($x,$e);
}
		
function dmodel_is_meta($x) {
	return false;
}
function dmodel_is_object($x) {
	return false;
}
